package com.xuxu.blog.service.impl;

import com.xuxu.common.utils.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.xuxu.common.utils.PageUtils;
import com.xuxu.common.utils.Query;

import com.xuxu.blog.dao.SignDao;
import com.xuxu.blog.entity.SignEntity;
import com.xuxu.blog.service.SignService;


@Service("signService")
public class SignServiceImpl extends ServiceImpl<SignDao, SignEntity> implements SignService {
    @Autowired
    SignDao signDao;
    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        IPage<SignEntity> page = this.page(
                new Query<SignEntity>().getPage(params),
                new QueryWrapper<SignEntity>()
        );

        return new PageUtils(page);
    }

    @Override
    public boolean isSigned(String username) {
        SignEntity signEntity = signDao.selectIsSigned(username);
        if (signEntity != null) {
            return true;
        }
        return false;
    }

}